package com.zretc.service.impl;

import com.zretc.dao.OrdersMapper;
import com.zretc.entity.OrderDetail;
import com.zretc.entity.Orders;
import com.zretc.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author WHP
 */
@Service
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public List<Orders> getAllOrders() {
        return ordersMapper.fingAllOrders();
    }

    @Override
    public Orders getOrderbyOrderId(String orderId) {
        return ordersMapper.findOrderbyOrderId(orderId);
    }

    @Override
    public int deleteByOrder(String orderId) {
        return ordersMapper.deleteByOrder(orderId);
    }

    @Override
    public int saveOrder(Orders orders) {
        return ordersMapper.insertOrder(orders);
    }

    @Override
    public int insertOrderDetail(OrderDetail orderDetail) {
        return ordersMapper.insertOrderDetail(orderDetail);
    }
}
